import request from '@/utils/request'

const learning = {
  // 资料管理
  learningMaterials (params) {
    return request.get('/zjk/learningMaterials/list', { params })
  },
  addLearningMaterials (data) {
    return request.post('/zjk/learningMaterials/add', data)
  },
  updateLearningMaterials (data) {
    return request.post('/zjk/learningMaterials/update', data)
  },
  deleteLearningMaterials (id) {
    return request.post(`/zjk/learningMaterials/delete/${id}`)
  },
  detailLearningMaterials (id) {
    return request.get(`/zjk/learningMaterials/detail/${id}`)
  },

  // 学习计划列表
  learningPlan (params) {
    return request.get('/zjk/learningPlan/list', { params })
  },
  addLearningPlan (data) {
    return request.post('/zjk/learningPlan/add', data)
  },
  updateLearningPlan (data) {
    return request.post('/zjk/learningPlan/update', data)
  },
  deleteLearningPlan (id) {
    return request.post(`/zjk/learningPlan/delete/${id}`)
  },
  // 学习记录列表
  learningRecord (params) {
    return request.get('/zjk/learningRecord/list', { params })
  },
  addLearningRecord (data) {
    return request.post('/zjk/learningRecord/add', data)
  },
  updateLearningRecord (data) {
    return request.post('/zjk/learningRecord/update', data)
  },
  deleteLearningRecord (id) {
    return request.post(`/zjk/learningRecord/delete/${id}`)
  },
  detailLearningRecord (id) {
    return request.get(`/zjk/learningRecord/detail/${id}`)
  },
}

export default learning;
